
import { WebsiteConfig } from "maishu-chitu-admin";
import { merchantRoleId } from "./global";

let websiteConfig: WebsiteConfig = {
    requirejs: {
        paths: {
            // "maishu-chitu-admin/static": "node_modules/maishu-chitu-admin/out/static/index"
        }
    },
    menuItems: [
        // {
        //     id: "AD03726E-DEA4-40EF-8017-8DCF56956F4F", icon: "icon-cog", name: "用户",
        //     sortNumber: 450,
        //     children: [
        //         { id: "3EF0449B-A703-45B6-B0B5-906351D42C1D", name: "用户列表", path: "#member/member-list" },
        //     ]
        // },
        {
            id: "7BD03F75-830A-4D39-BB37-6A0A7A47AD4E", icon: "icon-home", name: "首页", sortNumber: 80, path: "#index"
        },
        {
            id: "3D89190D-B0FC-4128-8B4A-2307E9E3A62D", icon: "icon-cog", name: "权限",
            sortNumber: 450,
            children: [
                { id: "DC512E7D-0F52-435D-AD1B-831BD04B9A7E", name: "员工权限", path: "#permission/employee" },
                { id: "16A1D09E-2261-4ADD-A164-1EC997023A57", name: "角色设置", path: "#permission/role" },
            ]
        }
    ]
}

let stack = [...websiteConfig.menuItems];
while (stack.length > 0) {
    let item = stack.shift();
    item.roleIds = [merchantRoleId];
    (item.children || []).forEach(child => {
        stack.unshift(child);
    })
}

export default websiteConfig;